package com.daykw.wenshu.utils;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;

@Configuration
public class Const {

	// @Autowired
	// private Environment environment;
	public static String Node;
	@Value("${article_thread}")
	private Boolean article_thread;

	@Value("${adhoc_list_thread}")
	private Boolean adhoc_list_thread;
	@Value("${daily_list_thread}")
	private Boolean daily_list_thread;
	@Value("${daily_list_sub_thread}")
	private Boolean daily_list_sub_thread;

	@Value("${article_num}")
	private Integer article_num = 50;

	public static int Thread_List = 2;

	public static int Thread_Article = 20;


	public static boolean init= false;
	



	public Boolean getDaily_list_sub_thread() {
		return daily_list_sub_thread;
	}



	public void setDaily_list_sub_thread(Boolean daily_list_sub_thread) {
		this.daily_list_sub_thread = daily_list_sub_thread;
	}





	public Boolean getArticle_thread() {
		return article_thread;
	}

	public void setArticle_thread(Boolean article_thread) {
		this.article_thread = article_thread;
	}

	
	public Boolean getAdhoc_list_thread() {
		return adhoc_list_thread;
	}

	public void setAdhoc_list_thread(Boolean adhoc_list_thread) {
		this.adhoc_list_thread = adhoc_list_thread;
	}

	public Boolean getDaily_list_thread() {
		return daily_list_thread;
	}

	public void setDaily_list_thread(Boolean daily_list_thread) {
		this.daily_list_thread = daily_list_thread;
	}

	public Integer getArticle_num() {
		return article_num;
	}



	public void setArticle_num(Integer article_num) {
		this.article_num = article_num;
	}



	public static void stopFirefox() {
		try {
			// 关闭程序和脚本
			Runtime runtime = Runtime.getRuntime();
			
			
			runtime.exec("taskkill /f /im firefox.exe");
			runtime.exec("taskkill /f /im firefox.exe*32");
			runtime.exec("taskkill /f /im geckodriver32.exe");
			runtime.exec("taskkill /f /im geckodriver64.exe");
			runtime.exec("taskkill /f /im chromedriver.exe*32");
			runtime.exec("taskkill /f /im chromedriver.exe");
			Thread.sleep(2000);
		} catch (Exception e) {

		}
	}
}
